package com.zhou.syt.hosp.controller;

import com.atguigu.yygh.model.hosp.Hospital;
import com.atguigu.yygh.vo.hosp.HospitalQueryVo;
import com.zhou.syt.common.result.Result;
import com.zhou.syt.hosp.service.HospitalService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName: HospitalController
 * @Description:
 * @Author: admin
 * @Date: 2022/1/9 15:49
 */
@RestController
@RequestMapping("")
@CrossOrigin
public class HospitalController {

    @Resource
    private HospitalService hospitalService;

    @GetMapping("/list/{page}/{limit}")
    public Result listHosp(@PathVariable Integer page,
                           @PathVariable Integer limit,
                           HospitalQueryVo hospitalQueryVo) {
      Page<Hospital> hospitals= hospitalService.selectHosPage(page,limit,hospitalQueryVo);
      return  Result.ok(hospitals);
    }
}
